/*
 * This file is part of the <a href="http://code.google.com/p/pux">PUX Framework</a>
 *
 * Copyright 2008-2009 by <a href="mailto:jfendler@polytechnic.edu.na">Jens Fendler</a>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package de.teamskill.pux.library.image;

import java.awt.image.BufferedImage;

import com.jhlabs.image.BlurFilter;

/**
 * ImageBlurNode
 * 
 * @author <a href="mailto:jfendler@polytechnic.edu.na">Jens Fendler</a>
 * 
 */
public class ImageBlurNode extends AbstractImageFilter {

	/**
	 * ImageBlurNode Constructor
	 * 
	 */
	public ImageBlurNode() {
		super("BLUR", false);
	}

	/**
	 * ImageBlurNode Constructor
	 * 
	 * @param nodeName
	 * @param continuous
	 */
	public ImageBlurNode(String nodeName, boolean continuous) {
		super(nodeName, continuous);
	}

	/**
	 * @see de.teamskill.pux.engine.AbstractNode#compute()
	 */
	@Override
	public void compute() {
		BlurFilter filter = new BlurFilter();
		BufferedImage source = (BufferedImage) in.fetchData();
		out.pushData(filter.filter(source, null));
	}

}
